home *** CD-ROM | disk | FTP | other *** search
/ Java for 3D & VRML Worlds / Java for 3d and VRML Worlds.iso / world / depth / depth.wrl < prev   
Text File  |  1996-10-17  |  3KB  |  175 lines

  1. #VRML V2.0 utf8
  2. #
  3. # "Motion Shadow Effect" with depth of shadow
  4. #     created by ask@krc.sony.co.jp (Masamichi zzzcat Asukai)
  5. #
  6. # Copyright(C) 1996 Sony Corporation. All rights reserved.
  7. #
  8.  
  9. NavigationInfo {
  10.     headlight FALSE
  11. }
  12.  
  13. Viewpoint {
  14.     position 0.0 1.75 30.0
  15. }
  16.  
  17. Background {
  18.     skyColor 0.5 0.3 0.7
  19. }
  20.  
  21. DEF TREE Transform {
  22.     translation 0 0 0
  23.     scale 3 3 3
  24.     children [
  25.         Billboard {
  26.             # "axisOfRotaion 0 1 0" doesn't work!
  27.             #axisOfRotaion 0 1 0
  28.             axisOfRotation 0 0 0
  29.             children [
  30.                 Shape {
  31.                     appearance Appearance {
  32.                         texture ImageTexture {
  33.                             url "tree.gif"
  34.                         }
  35.                     }
  36.                     geometry IndexedFaceSet {
  37.                         coord Coordinate {
  38.                             point [
  39.                             -0.5 0 0,
  40.                              0.5 0 0,
  41.                              0.5 1 0,
  42.                             -0.5 1 0,
  43.                             ]
  44.                         }
  45.                         coordIndex [
  46.                             0, 1, 2, 3, -1,
  47.                         ]
  48.                     }
  49.                 }
  50.             ]
  51.         }
  52.     ]
  53. }
  54.  
  55. DEF SHADOW Transform {
  56.     children [
  57.         Transform {
  58.             scale 3 3 3
  59.             rotation 1 0 0 -1.57
  60.             children [
  61.                 Shape {
  62.                     appearance Appearance {
  63.                          material DEF S_MAT Material {
  64.                             ambientIntensity 0
  65.                             diffuseColor 0 0 0
  66.                             transparency 0.3
  67.                         }
  68.                         texture ImageTexture {
  69.                             url "tree.gif"
  70.                         }
  71.                     }
  72.                     geometry IndexedFaceSet {
  73.                         coord Coordinate {
  74.                             point [
  75.                                 -0.5 0 0,
  76.                                  0.5 0 0,
  77.                                  0.5 1 0,
  78.                                 -0.5 1 0,
  79.                             ]
  80.                         }
  81.                         coordIndex [
  82.                             0, 1, 2, 3, -1,
  83.                         ]
  84.                     }
  85.                 }
  86.             ]
  87.         }
  88.     ]
  89. }
  90.  
  91. DEF LIGHT Transform {
  92.     translation -20 10 0
  93.     children [
  94.         PointLight {
  95.             intensity 1.0
  96.         }
  97.         Shape {
  98.             appearance Appearance {
  99.                 material Material {
  100.                     ambientIntensity 0
  101.                     diffuseColor 0 0 0
  102.                     emissiveColor 1 1 0
  103.                 }
  104.             }
  105.             geometry Sphere{
  106.                 radius 0.5
  107.             }
  108.         }
  109.     ]
  110. }
  111.  
  112. DEF L_TIME TimeSensor{
  113.     cycleInterval 10.0
  114.     stopTime -1
  115.     loop TRUE
  116. }
  117.  
  118. DEF POSINT PositionInterpolator{
  119.     set_fraction 0.5
  120.     key [0, 0.25, 0.5, 0.75, 1]
  121.     keyValue [-15 10 5, 5 15 5, 5 10 -15, -15 5 -15, -15 10 5]
  122. }
  123.  
  124. ROUTE L_TIME.fraction_changed TO POSINT.set_fraction
  125. ROUTE POSINT.value_changed TO LIGHT.set_translation
  126.  
  127.  
  128. DEF TIME TimeSensor{
  129.     cycleInterval 0.2
  130.     stopTime -1
  131.     loop TRUE
  132. }
  133.  
  134. DEF SCRIPT Script {
  135.     url "depth.class"
  136.     eventIn SFTime interval
  137.     eventOut SFRotation setRotation
  138.     eventOut SFVec3f setScale
  139.     eventOut SFFloat setTransparency
  140.     field SFNode light USE LIGHT
  141.     field SFNode tree USE TREE
  142. ROUTE TIME.cycleTime TO SCRIPT.interval
  143. ROUTE SCRIPT.setRotation TO SHADOW.set_rotation
  144. ROUTE SCRIPT.setScale TO SHADOW.set_scale
  145. ROUTE SCRIPT.setTransparency TO S_MAT.set_transparency
  146.  
  147.  
  148. DEF GROUND Transform {
  149.     translation 0 -0.1 0
  150.     children[
  151.         Shape {
  152.             appearance Appearance {
  153.                 material Material {
  154.                     diffuseColor 0.6 0.4 0.4
  155.                     emissiveColor 0.3 0.2 0.2
  156.                 }
  157.             }
  158.             geometry IndexedFaceSet {
  159.                 coord Coordinate {
  160.                     point [
  161.                         -30 0 -30,
  162.                         -30 0  30,
  163.                          30 0  30,
  164.                          30 0 -30,
  165.                     ]
  166.                 }
  167.                 coordIndex [
  168.                     0, 1, 2, 3, -1,
  169.                 ]
  170.             }
  171.                }
  172.     ]
  173. }
  174.